package com.yunhe.control;

import java.io.IOException;
import java.io.InputStream;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.yunhe.bean.ShopImfor;
import com.yunhe.service.GoodsBoardService;
import com.yunhe.util.MySession;

/**
 * Servlet implementation class deleteGoods
 */
@WebServlet("/deleteGoods.do")
public class deleteGoods extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public deleteGoods() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String sid = request.getParameter("sid");
		System.out.println(sid);
		ShopImfor s = new ShopImfor();
		s.setSid(Integer.parseInt(sid));
		GoodsBoardService gb=new GoodsBoardService();
		
		gb.deleteGoods(s);
		
		
		//request.getRequestDispatcher("showGoodList.do").forward(request, response);
	}

}
